﻿using Bootstrap.Definition.Enums;
using Bootstrap.Template.TemplateInnerItem;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bootstrap.Template.Textbox
{
   
    public partial class BootstrapTextboxTemplate
    {
        bool LeftAddonVisibilty { get; set; }
        bool RightAddonVisibilty { get; set; }
        bool PlaceHolderVisibilty { get; set; }
        bool ValueVisibilty { get; set; }
        string Size { get; set; }
        public BootstrapTextboxTemplateItem TempalteItem { get; set; }

        public BootstrapTextboxTemplate(BootstrapTextboxTemplateItem tempalteItem)
        {
            TempalteItem = tempalteItem;
            LeftAddonVisibilty = !string.IsNullOrEmpty(tempalteItem.LeftAddonText);
            RightAddonVisibilty = !string.IsNullOrEmpty(tempalteItem.RightAddonText);
            PlaceHolderVisibilty = !string.IsNullOrEmpty(tempalteItem.PlaceHolderText);
            ValueVisibilty = !string.IsNullOrEmpty(tempalteItem.Text);

            switch (tempalteItem.Size)
            {
                case SizeEnum.Small:
                    Size = " input-group-sm";
                    break;
                case SizeEnum.Large:
                    Size = " input-group-lg";
                    break;
                default:
                    Size = string.Empty;
                    break;
            }

        }
    }
}
